Skip to content

Conversation

@remyperona
Copy link
Contributor

@remyperona remyperona commented Apr 14, 2023

Fixes #721

Replace usage of FILTER_SANITIZE_STRING by htmlspecialchars(), as per the official PHP docs recommendation.

@remyperona remyperona added this to the 2.1.2 milestone Apr 14, 2023
@remyperona remyperona requested a review from a team April 14, 2023 15:41
@remyperona remyperona self-assigned this Apr 14, 2023
@vmanthos vmanthos self-requested a review May 25, 2023 11:45
@vmanthos
Copy link
Contributor

@Tabrisrp I checked the PR and the issue described in the original issue is resolved. 👏

I'm seeing the following notices in the debug.log:

PHP Warning:  Undefined array key "page" in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-views.php on line 468
PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-views.php on line 468

These are there both with PHP 8.1 & 8.2.

To reproduce:

  1. Visit the media library page: /wp-admin/upload.php
  2. See the notice in the debug.log.

Can you please look into this? 🙏

@remyperona remyperona changed the title Fixes #712 Replace usage of FILTER_SANITIZE_STRING Fixes #721 Replace usage of FILTER_SANITIZE_STRING May 25, 2023
@remyperona
Copy link
Contributor Author

@vmanthos Good catch, fixed it!

Copy link
Contributor

@vmanthos vmanthos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, @Tabrisrp! 🙏

This is working as expected! 👍

@vmanthos vmanthos merged commit c529cf9 into develop May 26, 2023
@vmanthos vmanthos deleted the fix/721-deprecated-filter branch May 26, 2023 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FILTER_SANITIZE_STRING deprecation notice with PHP 8.1

4 participants